home *** CD-ROM | disk | FTP | other *** search
- property spr, mem
- property interessados
- property linhaAtual, linhaMax
- property numLinhas
- property alturaLinha, linhasJanela
-
- on getPropertyDescriptionList
- set p_list = [ ¬
- #interessados: [ #comment: "Sprites que se interessam pelo scroll:", ¬
- #format: #list, ¬
- #default: [] ] ¬
- ]
- return p_list
- end
-
- on beginSprite me
- set spr = the spriteNum of me
- set mem = the member of sprite spr
- set linhaAtual = 1
- set numLinhas = the lineCount of member mem
- set alturaLinha = lineheight(mem, 1)
- set linhasJanela = the height of sprite spr / alturaLinha
- set linhaMax = numLinhas - alturaLinha/2
- if linhaMax < 1 then set linhaMax = 1
- end
-
- on mouseDown me
- set y_ini = the mouseV
- set linha_ini = linhaAtual
- global gCritico, gMustUpdate
- set gCritico = gCritico + 1
- repeat while the mouseDown
- set gMustUpdate = false
- sendAllSprites(#idleSprite)
- set y = the mouseV
- set l = - (y - y_ini) / alturaLinha + linha_ini
- if l < 1 then
- set l = 1
- else if l > linhaMax then
- set l = linhaMax
- end if
- if l <> linhaAtual then
- scrollByLine member mem, l-linhaAtual
- set gMustUpdate = true
- if count(interessados) > 0 then
- repeat with i = 1 to count(interessados)
- sendSprite(getAt(interessados,i), #scrollLinha, l - linhaAtual)
- end repeat
- end if
- set linhaAtual = l
- end if
- if gMustUpdate then updateStage
- end repeat
- set gCritico = gCritico -1
- end